Integrand size = 39, antiderivative size = 157 \[ \int \frac {\left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x)}{(a+a \cos (c+d x))^4} \, dx=\frac {A \text {arctanh}(\sin (c+d x))}{a^4 d}-\frac {(55 A-6 B-8 C) \sin (c+d x)}{105 a^4 d (1+\cos (c+d x))^2}-\frac {2 (80 A-3 B-4 C) \sin (c+d x)}{105 a^4 d (1+\cos (c+d x))}-\frac {(A-B+C) \sin (c+d x)}{7 d (a+a \cos (c+d x))^4}-\frac {(10 A-3 B-4 C) \sin (c+d x)}{35 a d (a+a \cos (c+d x))^3} \]
A*arctanh(sin(d*x+c))/a^4/d-1/105*(55*A-6*B-8*C)*sin(d*x+c)/a^4/d/(1+cos(d *x+c))^2-2/105*(80*A-3*B-4*C)*sin(d*x+c)/a^4/d/(1+cos(d*x+c))-1/7*(A-B+C)* sin(d*x+c)/d/(a+a*cos(d*x+c))^4-1/35*(10*A-3*B-4*C)*sin(d*x+c)/a/d/(a+a*co s(d*x+c))^3
Leaf count is larger than twice the leaf count of optimal. \(334\) vs. \(2(157)=314\).
Time = 4.50 (sec) , antiderivative size = 334, normalized size of antiderivative = 2.13 \[ \int \frac {\left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x)}{(a+a \cos (c+d x))^4} \, dx=-\frac {\left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \left (6720 A \cos ^8\left (\frac {1}{2} (c+d x)\right ) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+\cos \left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {c}{2}\right ) \left (70 (49 A-3 B-2 C) \sin \left (\frac {d x}{2}\right )-70 (31 A-2 C) \sin \left (c+\frac {d x}{2}\right )+2625 A \sin \left (c+\frac {3 d x}{2}\right )-126 B \sin \left (c+\frac {3 d x}{2}\right )-168 C \sin \left (c+\frac {3 d x}{2}\right )-735 A \sin \left (2 c+\frac {3 d x}{2}\right )+1015 A \sin \left (2 c+\frac {5 d x}{2}\right )-42 B \sin \left (2 c+\frac {5 d x}{2}\right )-56 C \sin \left (2 c+\frac {5 d x}{2}\right )-105 A \sin \left (3 c+\frac {5 d x}{2}\right )+160 A \sin \left (3 c+\frac {7 d x}{2}\right )-6 B \sin \left (3 c+\frac {7 d x}{2}\right )-8 C \sin \left (3 c+\frac {7 d x}{2}\right )\right )\right )}{210 a^4 d (1+\cos (c+d x))^4 (2 A+C+2 B \cos (c+d x)+C \cos (2 (c+d x)))} \]
-1/210*((A + B*Cos[c + d*x] + C*Cos[c + d*x]^2)*(6720*A*Cos[(c + d*x)/2]^8 *(Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]]) + Cos[(c + d*x)/2]*Sec[c/2]*(70*(49*A - 3*B - 2*C)*Sin[(d*x)/ 2] - 70*(31*A - 2*C)*Sin[c + (d*x)/2] + 2625*A*Sin[c + (3*d*x)/2] - 126*B* Sin[c + (3*d*x)/2] - 168*C*Sin[c + (3*d*x)/2] - 735*A*Sin[2*c + (3*d*x)/2] + 1015*A*Sin[2*c + (5*d*x)/2] - 42*B*Sin[2*c + (5*d*x)/2] - 56*C*Sin[2*c + (5*d*x)/2] - 105*A*Sin[3*c + (5*d*x)/2] + 160*A*Sin[3*c + (7*d*x)/2] - 6 *B*Sin[3*c + (7*d*x)/2] - 8*C*Sin[3*c + (7*d*x)/2])))/(a^4*d*(1 + Cos[c + d*x])^4*(2*A + C + 2*B*Cos[c + d*x] + C*Cos[2*(c + d*x)]))
Time = 1.09 (sec) , antiderivative size = 177, normalized size of antiderivative = 1.13, number of steps used = 11, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.282, Rules used = {3042, 3520, 3042, 3457, 3042, 3457, 3042, 3457, 27, 3042, 4257}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\sec (c+d x) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right )}{(a \cos (c+d x)+a)^4} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A+B \sin \left (c+d x+\frac {\pi }{2}\right )+C \sin \left (c+d x+\frac {\pi }{2}\right )^2}{\sin \left (c+d x+\frac {\pi }{2}\right ) \left (a \sin \left (c+d x+\frac {\pi }{2}\right )+a\right )^4}dx\) |
\(\Big \downarrow \) 3520 |
\(\displaystyle \frac {\int \frac {(7 a A-a (3 A-3 B-4 C) \cos (c+d x)) \sec (c+d x)}{(\cos (c+d x) a+a)^3}dx}{7 a^2}-\frac {(A-B+C) \sin (c+d x)}{7 d (a \cos (c+d x)+a)^4}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {7 a A-a (3 A-3 B-4 C) \sin \left (c+d x+\frac {\pi }{2}\right )}{\sin \left (c+d x+\frac {\pi }{2}\right ) \left (\sin \left (c+d x+\frac {\pi }{2}\right ) a+a\right )^3}dx}{7 a^2}-\frac {(A-B+C) \sin (c+d x)}{7 d (a \cos (c+d x)+a)^4}\) |
\(\Big \downarrow \) 3457 |
\(\displaystyle \frac {\frac {\int \frac {\left (35 a^2 A-2 a^2 (10 A-3 B-4 C) \cos (c+d x)\right ) \sec (c+d x)}{(\cos (c+d x) a+a)^2}dx}{5 a^2}-\frac {a (10 A-3 B-4 C) \sin (c+d x)}{5 d (a \cos (c+d x)+a)^3}}{7 a^2}-\frac {(A-B+C) \sin (c+d x)}{7 d (a \cos (c+d x)+a)^4}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {\int \frac {35 a^2 A-2 a^2 (10 A-3 B-4 C) \sin \left (c+d x+\frac {\pi }{2}\right )}{\sin \left (c+d x+\frac {\pi }{2}\right ) \left (\sin \left (c+d x+\frac {\pi }{2}\right ) a+a\right )^2}dx}{5 a^2}-\frac {a (10 A-3 B-4 C) \sin (c+d x)}{5 d (a \cos (c+d x)+a)^3}}{7 a^2}-\frac {(A-B+C) \sin (c+d x)}{7 d (a \cos (c+d x)+a)^4}\) |
\(\Big \downarrow \) 3457 |
\(\displaystyle \frac {\frac {\frac {\int \frac {\left (105 a^3 A-a^3 (55 A-6 B-8 C) \cos (c+d x)\right ) \sec (c+d x)}{\cos (c+d x) a+a}dx}{3 a^2}-\frac {(55 A-6 B-8 C) \sin (c+d x)}{3 d (\cos (c+d x)+1)^2}}{5 a^2}-\frac {a (10 A-3 B-4 C) \sin (c+d x)}{5 d (a \cos (c+d x)+a)^3}}{7 a^2}-\frac {(A-B+C) \sin (c+d x)}{7 d (a \cos (c+d x)+a)^4}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {\frac {\int \frac {105 a^3 A-a^3 (55 A-6 B-8 C) \sin \left (c+d x+\frac {\pi }{2}\right )}{\sin \left (c+d x+\frac {\pi }{2}\right ) \left (\sin \left (c+d x+\frac {\pi }{2}\right ) a+a\right )}dx}{3 a^2}-\frac {(55 A-6 B-8 C) \sin (c+d x)}{3 d (\cos (c+d x)+1)^2}}{5 a^2}-\frac {a (10 A-3 B-4 C) \sin (c+d x)}{5 d (a \cos (c+d x)+a)^3}}{7 a^2}-\frac {(A-B+C) \sin (c+d x)}{7 d (a \cos (c+d x)+a)^4}\) |
\(\Big \downarrow \) 3457 |
\(\displaystyle \frac {\frac {\frac {\frac {\int 105 a^4 A \sec (c+d x)dx}{a^2}-\frac {2 a^3 (80 A-3 B-4 C) \sin (c+d x)}{d (a \cos (c+d x)+a)}}{3 a^2}-\frac {(55 A-6 B-8 C) \sin (c+d x)}{3 d (\cos (c+d x)+1)^2}}{5 a^2}-\frac {a (10 A-3 B-4 C) \sin (c+d x)}{5 d (a \cos (c+d x)+a)^3}}{7 a^2}-\frac {(A-B+C) \sin (c+d x)}{7 d (a \cos (c+d x)+a)^4}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {\frac {\frac {105 a^2 A \int \sec (c+d x)dx-\frac {2 a^3 (80 A-3 B-4 C) \sin (c+d x)}{d (a \cos (c+d x)+a)}}{3 a^2}-\frac {(55 A-6 B-8 C) \sin (c+d x)}{3 d (\cos (c+d x)+1)^2}}{5 a^2}-\frac {a (10 A-3 B-4 C) \sin (c+d x)}{5 d (a \cos (c+d x)+a)^3}}{7 a^2}-\frac {(A-B+C) \sin (c+d x)}{7 d (a \cos (c+d x)+a)^4}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {\frac {105 a^2 A \int \csc \left (c+d x+\frac {\pi }{2}\right )dx-\frac {2 a^3 (80 A-3 B-4 C) \sin (c+d x)}{d (a \cos (c+d x)+a)}}{3 a^2}-\frac {(55 A-6 B-8 C) \sin (c+d x)}{3 d (\cos (c+d x)+1)^2}}{5 a^2}-\frac {a (10 A-3 B-4 C) \sin (c+d x)}{5 d (a \cos (c+d x)+a)^3}}{7 a^2}-\frac {(A-B+C) \sin (c+d x)}{7 d (a \cos (c+d x)+a)^4}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {\frac {\frac {\frac {105 a^2 A \text {arctanh}(\sin (c+d x))}{d}-\frac {2 a^3 (80 A-3 B-4 C) \sin (c+d x)}{d (a \cos (c+d x)+a)}}{3 a^2}-\frac {(55 A-6 B-8 C) \sin (c+d x)}{3 d (\cos (c+d x)+1)^2}}{5 a^2}-\frac {a (10 A-3 B-4 C) \sin (c+d x)}{5 d (a \cos (c+d x)+a)^3}}{7 a^2}-\frac {(A-B+C) \sin (c+d x)}{7 d (a \cos (c+d x)+a)^4}\) |
-1/7*((A - B + C)*Sin[c + d*x])/(d*(a + a*Cos[c + d*x])^4) + (-1/5*(a*(10* A - 3*B - 4*C)*Sin[c + d*x])/(d*(a + a*Cos[c + d*x])^3) + (-1/3*((55*A - 6 *B - 8*C)*Sin[c + d*x])/(d*(1 + Cos[c + d*x])^2) + ((105*a^2*A*ArcTanh[Sin [c + d*x]])/d - (2*a^3*(80*A - 3*B - 4*C)*Sin[c + d*x])/(d*(a + a*Cos[c + d*x])))/(3*a^2))/(5*a^2))/(7*a^2)
3.4.69.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim p[b*(A*b - a*B)*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x])^( n + 1)/(a*f*(2*m + 1)*(b*c - a*d))), x] + Simp[1/(a*(2*m + 1)*(b*c - a*d)) Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*Simp[B*(a*c*m + b *d*(n + 1)) + A*(b*c*(m + 1) - a*d*(2*m + n + 2)) + d*(A*b - a*B)*(m + n + 2)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && NeQ [b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && LtQ[m, -2^(-1)] && !GtQ[n, 0] && IntegerQ[2*m] && (IntegerQ[2*n] || EqQ[c, 0])
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(a*A - b*B + a*C)*Cos[e + f*x]*(a + b* Sin[e + f*x])^m*((c + d*Sin[e + f*x])^(n + 1)/(f*(b*c - a*d)*(2*m + 1))), x ] + Simp[1/(b*(b*c - a*d)*(2*m + 1)) Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*Simp[A*(a*c*(m + 1) - b*d*(2*m + n + 2)) + B*(b*c*m + a *d*(n + 1)) - C*(a*c*m + b*d*(n + 1)) + (d*(a*A - b*B)*(m + n + 2) + C*(b*c *(2*m + 1) - a*d*(m - n - 1)))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c ^2 - d^2, 0] && LtQ[m, -2^(-1)]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Time = 1.99 (sec) , antiderivative size = 123, normalized size of antiderivative = 0.78
method | result | size |
parallelrisch | \(\frac {-840 A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+840 A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-15 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\left (A -B +C \right ) \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (7 A -\frac {21 B}{5}+\frac {7 C}{5}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {77 A}{3}-7 B -\frac {7 C}{3}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+105 A -7 B -7 C \right )}{840 a^{4} d}\) | \(123\) |
derivativedivides | \(\frac {-\frac {\left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) A}{7}+\frac {\left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) B}{7}-\frac {\left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) C}{7}+\frac {3 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) B}{5}-A \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {\left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) C}{5}-\frac {11 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) A}{3}+\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) C}{3}+8 A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-15 A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C +\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) B +B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-8 A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8 d \,a^{4}}\) | \(199\) |
default | \(\frac {-\frac {\left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) A}{7}+\frac {\left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) B}{7}-\frac {\left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) C}{7}+\frac {3 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) B}{5}-A \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {\left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) C}{5}-\frac {11 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) A}{3}+\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) C}{3}+8 A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-15 A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C +\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) B +B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-8 A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8 d \,a^{4}}\) | \(199\) |
norman | \(\frac {-\frac {\left (A -B +C \right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{56 a d}-\frac {\left (15 A -B -C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{8 a d}-\frac {\left (45 A -31 B +17 C \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{280 a d}-\frac {\left (101 A -9 B -7 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{24 a d}-\frac {\left (175 A -27 B -11 C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{60 a d}-\frac {\left (305 A -123 B +11 C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{420 a d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2} a^{3}}+\frac {A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{a^{4} d}-\frac {A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{a^{4} d}\) | \(231\) |
risch | \(-\frac {2 i \left (105 A \,{\mathrm e}^{6 i \left (d x +c \right )}+735 A \,{\mathrm e}^{5 i \left (d x +c \right )}+2170 A \,{\mathrm e}^{4 i \left (d x +c \right )}-140 C \,{\mathrm e}^{4 i \left (d x +c \right )}+3430 A \,{\mathrm e}^{3 i \left (d x +c \right )}-210 B \,{\mathrm e}^{3 i \left (d x +c \right )}-140 C \,{\mathrm e}^{3 i \left (d x +c \right )}+2625 A \,{\mathrm e}^{2 i \left (d x +c \right )}-126 B \,{\mathrm e}^{2 i \left (d x +c \right )}-168 C \,{\mathrm e}^{2 i \left (d x +c \right )}+1015 A \,{\mathrm e}^{i \left (d x +c \right )}-42 B \,{\mathrm e}^{i \left (d x +c \right )}-56 C \,{\mathrm e}^{i \left (d x +c \right )}+160 A -6 B -8 C \right )}{105 d \,a^{4} \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )^{7}}+\frac {A \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{a^{4} d}-\frac {A \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{a^{4} d}\) | \(233\) |
1/840*(-840*A*ln(tan(1/2*d*x+1/2*c)-1)+840*A*ln(tan(1/2*d*x+1/2*c)+1)-15*t an(1/2*d*x+1/2*c)*((A-B+C)*tan(1/2*d*x+1/2*c)^6+(7*A-21/5*B+7/5*C)*tan(1/2 *d*x+1/2*c)^4+(77/3*A-7*B-7/3*C)*tan(1/2*d*x+1/2*c)^2+105*A-7*B-7*C))/a^4/ d
Time = 0.27 (sec) , antiderivative size = 248, normalized size of antiderivative = 1.58 \[ \int \frac {\left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x)}{(a+a \cos (c+d x))^4} \, dx=\frac {105 \, {\left (A \cos \left (d x + c\right )^{4} + 4 \, A \cos \left (d x + c\right )^{3} + 6 \, A \cos \left (d x + c\right )^{2} + 4 \, A \cos \left (d x + c\right ) + A\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - 105 \, {\left (A \cos \left (d x + c\right )^{4} + 4 \, A \cos \left (d x + c\right )^{3} + 6 \, A \cos \left (d x + c\right )^{2} + 4 \, A \cos \left (d x + c\right ) + A\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (2 \, {\left (80 \, A - 3 \, B - 4 \, C\right )} \cos \left (d x + c\right )^{3} + {\left (535 \, A - 24 \, B - 32 \, C\right )} \cos \left (d x + c\right )^{2} + {\left (620 \, A - 39 \, B - 52 \, C\right )} \cos \left (d x + c\right ) + 260 \, A - 36 \, B - 13 \, C\right )} \sin \left (d x + c\right )}{210 \, {\left (a^{4} d \cos \left (d x + c\right )^{4} + 4 \, a^{4} d \cos \left (d x + c\right )^{3} + 6 \, a^{4} d \cos \left (d x + c\right )^{2} + 4 \, a^{4} d \cos \left (d x + c\right ) + a^{4} d\right )}} \]
integrate((A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)/(a+a*cos(d*x+c))^4,x, algorithm="fricas")
1/210*(105*(A*cos(d*x + c)^4 + 4*A*cos(d*x + c)^3 + 6*A*cos(d*x + c)^2 + 4 *A*cos(d*x + c) + A)*log(sin(d*x + c) + 1) - 105*(A*cos(d*x + c)^4 + 4*A*c os(d*x + c)^3 + 6*A*cos(d*x + c)^2 + 4*A*cos(d*x + c) + A)*log(-sin(d*x + c) + 1) - 2*(2*(80*A - 3*B - 4*C)*cos(d*x + c)^3 + (535*A - 24*B - 32*C)*c os(d*x + c)^2 + (620*A - 39*B - 52*C)*cos(d*x + c) + 260*A - 36*B - 13*C)* sin(d*x + c))/(a^4*d*cos(d*x + c)^4 + 4*a^4*d*cos(d*x + c)^3 + 6*a^4*d*cos (d*x + c)^2 + 4*a^4*d*cos(d*x + c) + a^4*d)
\[ \int \frac {\left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x)}{(a+a \cos (c+d x))^4} \, dx=\frac {\int \frac {A \sec {\left (c + d x \right )}}{\cos ^{4}{\left (c + d x \right )} + 4 \cos ^{3}{\left (c + d x \right )} + 6 \cos ^{2}{\left (c + d x \right )} + 4 \cos {\left (c + d x \right )} + 1}\, dx + \int \frac {B \cos {\left (c + d x \right )} \sec {\left (c + d x \right )}}{\cos ^{4}{\left (c + d x \right )} + 4 \cos ^{3}{\left (c + d x \right )} + 6 \cos ^{2}{\left (c + d x \right )} + 4 \cos {\left (c + d x \right )} + 1}\, dx + \int \frac {C \cos ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{\cos ^{4}{\left (c + d x \right )} + 4 \cos ^{3}{\left (c + d x \right )} + 6 \cos ^{2}{\left (c + d x \right )} + 4 \cos {\left (c + d x \right )} + 1}\, dx}{a^{4}} \]
(Integral(A*sec(c + d*x)/(cos(c + d*x)**4 + 4*cos(c + d*x)**3 + 6*cos(c + d*x)**2 + 4*cos(c + d*x) + 1), x) + Integral(B*cos(c + d*x)*sec(c + d*x)/( cos(c + d*x)**4 + 4*cos(c + d*x)**3 + 6*cos(c + d*x)**2 + 4*cos(c + d*x) + 1), x) + Integral(C*cos(c + d*x)**2*sec(c + d*x)/(cos(c + d*x)**4 + 4*cos (c + d*x)**3 + 6*cos(c + d*x)**2 + 4*cos(c + d*x) + 1), x))/a**4
Leaf count of result is larger than twice the leaf count of optimal. 313 vs. \(2 (149) = 298\).
Time = 0.22 (sec) , antiderivative size = 313, normalized size of antiderivative = 1.99 \[ \int \frac {\left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x)}{(a+a \cos (c+d x))^4} \, dx=-\frac {5 \, A {\left (\frac {\frac {315 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {77 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {21 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + \frac {3 \, \sin \left (d x + c\right )^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}}}{a^{4}} - \frac {168 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a^{4}} + \frac {168 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a^{4}}\right )} - \frac {C {\left (\frac {105 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {35 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} - \frac {21 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} - \frac {15 \, \sin \left (d x + c\right )^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}}\right )}}{a^{4}} - \frac {3 \, B {\left (\frac {35 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {35 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {21 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + \frac {5 \, \sin \left (d x + c\right )^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}}\right )}}{a^{4}}}{840 \, d} \]
integrate((A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)/(a+a*cos(d*x+c))^4,x, algorithm="maxima")
-1/840*(5*A*((315*sin(d*x + c)/(cos(d*x + c) + 1) + 77*sin(d*x + c)^3/(cos (d*x + c) + 1)^3 + 21*sin(d*x + c)^5/(cos(d*x + c) + 1)^5 + 3*sin(d*x + c) ^7/(cos(d*x + c) + 1)^7)/a^4 - 168*log(sin(d*x + c)/(cos(d*x + c) + 1) + 1 )/a^4 + 168*log(sin(d*x + c)/(cos(d*x + c) + 1) - 1)/a^4) - C*(105*sin(d*x + c)/(cos(d*x + c) + 1) + 35*sin(d*x + c)^3/(cos(d*x + c) + 1)^3 - 21*sin (d*x + c)^5/(cos(d*x + c) + 1)^5 - 15*sin(d*x + c)^7/(cos(d*x + c) + 1)^7) /a^4 - 3*B*(35*sin(d*x + c)/(cos(d*x + c) + 1) + 35*sin(d*x + c)^3/(cos(d* x + c) + 1)^3 + 21*sin(d*x + c)^5/(cos(d*x + c) + 1)^5 + 5*sin(d*x + c)^7/ (cos(d*x + c) + 1)^7)/a^4)/d
Time = 0.40 (sec) , antiderivative size = 248, normalized size of antiderivative = 1.58 \[ \int \frac {\left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x)}{(a+a \cos (c+d x))^4} \, dx=\frac {\frac {840 \, A \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{a^{4}} - \frac {840 \, A \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{a^{4}} - \frac {15 \, A a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 15 \, B a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 15 \, C a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 105 \, A a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 63 \, B a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 21 \, C a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 385 \, A a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 105 \, B a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 35 \, C a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 1575 \, A a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 105 \, B a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 105 \, C a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{28}}}{840 \, d} \]
1/840*(840*A*log(abs(tan(1/2*d*x + 1/2*c) + 1))/a^4 - 840*A*log(abs(tan(1/ 2*d*x + 1/2*c) - 1))/a^4 - (15*A*a^24*tan(1/2*d*x + 1/2*c)^7 - 15*B*a^24*t an(1/2*d*x + 1/2*c)^7 + 15*C*a^24*tan(1/2*d*x + 1/2*c)^7 + 105*A*a^24*tan( 1/2*d*x + 1/2*c)^5 - 63*B*a^24*tan(1/2*d*x + 1/2*c)^5 + 21*C*a^24*tan(1/2* d*x + 1/2*c)^5 + 385*A*a^24*tan(1/2*d*x + 1/2*c)^3 - 105*B*a^24*tan(1/2*d* x + 1/2*c)^3 - 35*C*a^24*tan(1/2*d*x + 1/2*c)^3 + 1575*A*a^24*tan(1/2*d*x + 1/2*c) - 105*B*a^24*tan(1/2*d*x + 1/2*c) - 105*C*a^24*tan(1/2*d*x + 1/2* c))/a^28)/d
Time = 1.24 (sec) , antiderivative size = 199, normalized size of antiderivative = 1.27 \[ \int \frac {\left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x)}{(a+a \cos (c+d x))^4} \, dx=\frac {2\,A\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a^4\,d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {A-B+C}{8\,a^4}+\frac {4\,A-2\,B}{8\,a^4}+\frac {4\,A+2\,B}{8\,a^4}+\frac {6\,A-2\,C}{8\,a^4}\right )}{d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {A-B+C}{24\,a^4}+\frac {4\,A-2\,B}{24\,a^4}+\frac {6\,A-2\,C}{24\,a^4}\right )}{d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (\frac {A-B+C}{40\,a^4}+\frac {4\,A-2\,B}{40\,a^4}\right )}{d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (A-B+C\right )}{56\,a^4\,d} \]
(2*A*atanh(tan(c/2 + (d*x)/2)))/(a^4*d) - (tan(c/2 + (d*x)/2)*((A - B + C) /(8*a^4) + (4*A - 2*B)/(8*a^4) + (4*A + 2*B)/(8*a^4) + (6*A - 2*C)/(8*a^4) ))/d - (tan(c/2 + (d*x)/2)^3*((A - B + C)/(24*a^4) + (4*A - 2*B)/(24*a^4) + (6*A - 2*C)/(24*a^4)))/d - (tan(c/2 + (d*x)/2)^5*((A - B + C)/(40*a^4) + (4*A - 2*B)/(40*a^4)))/d - (tan(c/2 + (d*x)/2)^7*(A - B + C))/(56*a^4*d)